<!--box slide right-->
<div class="box_slide left clearfix">
    <div class="head_box_slide">
        <span class="block span_title_slide icon_happen_32">HAPPENING</span>
        <span class="block hp_loading"></span>
    </div>
    <div class="content_box_slide happen_ajax">
        <!-- contnet-->
        <ul>
          <?php
            if(!empty($data)):
                foreach ($data as $data):?>
                
                    <li class="dayago icon_pin_16">
                    
                        <span class="day">
                            <?php echo timespan($data->created);?> ago
                        </span> 
                        
                        <strong class="user_credit">
                            <?php echo ' '.$data->username;?>
                        </strong> 
                        
                        completed 
                        <?php 
                            if($data->type){
                                echo '<a href="'.base_url().'offer/detail/'.$data->idoff.'" target="_blank"> '.$data->name,'</a>';
                            }else{
                                echo '<a href="'.base_url().'offer/wall"> '.$data->name,'</a>';
                            }
                            
                        ?>                       
                        
                        and earned <span id="tien"><?php echo $data->point;?></span><span class="point_iconn"></span>
                    </li>        
        
            <?php endforeach;endif;?>
        </ul>
        <!-- end content-->
        
    </div>
    <div class="bottom_box_slide"></div>
</div>
<!--end box slide right-->	
<!--script ajax autoload-->
<script>
$(document).ready(function(){
    setInterval(function() {
        $('.hp_loading').html('<img src="<?= base_url()?>temp/images/load.gif"/>');
        $('.happen_ajax').load('<?php echo base_url();?>slidebar/ajax/happen');       
        $('.hp_loading img').fadeOut(1000);
      // Do something every 5 seconds
}, 5000);
})

</script>				     